package com.campus.shop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.campus.shop.common.ConstantProperties;
import com.campus.shop.controller.web.vo.GoodsCartVo;
import com.campus.shop.entity.ShopCart;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 *
 * @author xr
 * @since 2023-12-362 15:13:50
 */
@Mapper
@Repository
public interface ShopCartMapper extends BaseMapper<ShopCart> {
    Integer getCartNum(Integer userId, Integer payStatus);

    List<GoodsCartVo> getCartList(Integer userId, Integer payStatus);

    void changePayStatus(Integer[] ids, Integer payStatus);

    List<GoodsCartVo> getCartListById(@Param("ids") Integer[] ids, @Param("userId") Integer userId);

    @Update("UPDATE tb_shop_cart SET pay_status = #{payStatus} WHERE id = #{ids}")
    void updateBatchByIds(@Param("ids") List<Integer> ids, @Param("payStatus") Integer payStatus);



}
